package com.zzxx.mapper;

import com.zzxx.entity.Gym;
import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;

import java.util.List;

public interface GymMapperEx {
    @Results({
            @Result(column="id", property="id", jdbcType= JdbcType.VARCHAR, id=true),
            @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
            @Result(column="describe", property="describe", jdbcType=JdbcType.VARCHAR),
            @Result(column="itemDesc", property="itemdesc", jdbcType=JdbcType.VARCHAR),
            @Result(column="note", property="note", jdbcType=JdbcType.VARCHAR),
            @Result(column="principalID", property="principalid", jdbcType=JdbcType.VARCHAR),
            @Result(column="address", property="address", jdbcType=JdbcType.VARCHAR),
            @Result(column = "principalID",property = "manager",
                    one = @One(select = "com.zzxx.mapper.ManagerMapper.selectByPrimaryKey"))
    })
    @Select("select * from gym")
    List<Gym> findAll();
}
